<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <title>添加(编辑)商品</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="/css/see/reset.min.css">
    <!--<link rel="stylesheet" href="/plugins/iosselect/iosselect.css">-->
    <link rel="stylesheet" href="/css/see/addGoods.min.css?v=<%=$version%>">
</head>
<body>
<div id="addGoods" v-cloak>
    <div class="circleBar-top">
        <span class="goback" @click="getBack()"></span>
        {{name}}
        <input type="submit" class="seeIndex-setUp" @click="saveProduct()" value="完成">
    </div>
    <div class="addGoods">
        <div class="addGoods-name">
            <div class="addGoods-nameText">
                <input type="text" v-model="list.title" placeholder="请输入商品名称">
            </div>
            <div class="addGoods-cover">
                <div class="addGoods-coverTitle">商品图片</div>
                <div class="addGoods-coverImg clearfix">
                    <template v-if="freightData||productIdInfo.images">
                         <span class="coverImg-main" :id="'coverCent'+index" v-if="index<5" v-for="(item,index) in productIdInfo.images">
                            <img :src="item.imgSrc" alt="" :id="'coverImg'+index" v-if="type==1">
                            <img :src="item" alt="" :id="'coverImg'+index" v-if="type!=1">
                            <input type="file" :id="'fileinput'+index" accept="image/*" @change="getChange(index)">
                            <span :id="'coverlable'+index" class="coverImg-show" v-if="index==0">主图</span>
                            <strong :id="'coverBtn'+index" class="coverImg-show" @click="deleteProductByImgId(index,item.imgId)"></strong>
                        </span>
                        <span class="coverImg-main" :id="'coverCent'+number" v-if="number>0">
                            <img src="" :id="'coverImg'+number">
                            <input type="file" :id="'fileinput'+number" capture="camera" accept="image/*" @change="getChange(number)">
                            <span :id="'coverlable'+number">主图</span>
                            <strong :id="'coverBtn'+number" @click="getClose(number)"></strong>
                        </span>
                        <!--<span class="coverImg-details" :id="'coverCent'+index" v-else>-->
                        <!--<img src="" alt="" :id="'coverImg'+index">-->
                        <!--<input type="file" :id="'fileinput'+index" name="coverImgSrc"  capture="camera" accept="image/*" @change="getChange(index)">-->
                        <!--<strong :id="'coverBtn'+index" @click="getClose(index)"></strong>-->
                        <!--</span>-->
                    </template>
                    <template v-else-if="!freightData">
                         <span class="coverImg-main" :id="'coverCent'+index" v-for="(item,index) in number">
                            <img src="" alt="" :id="'coverImg'+index">
                            <input type="file" :id="'fileinput'+index" accept="image/*" @change="getChange(index)">
                            <span :id="'coverlable'+index" v-if="index==0">主图</span>
                            <strong :id="'coverBtn'+index" @click="getClose(index)"></strong>
                        </span>
                        <!--<span class="coverImg-details" :id="'coverCent'+index" v-else>-->
                        <!--<img src="" alt="" :id="'coverImg'+index">-->
                        <!--<input type="file" :id="'fileinput'+index" name="coverImgSrc"  capture="camera" accept="image/*" @change="getChange(index)">-->
                        <!--<strong :id="'coverBtn'+index" @click="getClose(index)"></strong>-->
                        <!--</span>-->
                    </template>
                </div>
            </div>
        </div>
        <div class="addGoods-class">
            商品分类
            <span class="centCent-more" @click="getIsScreen(1)">{{initId3Name}}</span>
        </div>
        <div class="addGoods-freight">
            运费
            <span class="centCent-more" @click="getNext(2)">{{freightName}}</span>
        </div>
        <div class="addGoods-cent" v-for="(item,index) in formatNum">
            <div class="cent-format">
                商品型号
                <input type="text" v-model="list.model[index]">
            </div>
            <div class="cent-price">
                商品单价
                <div class="cent-priceCent">
                    <input type="number" pattern="[0-9]*" v-model.number="list.price[index]">
                    <span>元</span>
                </div>
            </div>
            <div class="cent-stock">
                商品库存
                <input type="number" pattern="[0-9]*" v-model.number="list.num[index]">
                <span>件</span>
            </div>
            <strong class="cent-close" @click="getAddBtn(2,index)" v-if="type==2||type==3"></strong>
            <strong class="cent-close" @click="deleteSku(index,list.skuId[index])" v-if="type==1"></strong>
        </div>
        <div class="addGoods-addBtn">
            <span @click="getAddBtn(1)">添加商品型号</span>
        </div>
        <div class="addGoods-freight addGoods-describe">
            商品图文描述
            <span class="centCent-more" @click="getNext(1)">{{infoName||"未添加"}}</span>
        </div>
    </div>
    <div id="mask" @click="getIsScreen()" :class="{'maskShow':isScreen}"></div>
    <div id="screen" :class="{'maskShow':isScreen}">
        <template v-if="isScreen==1">
            <div class="screen-title">商品分类</div>
            <div class="position-category clearfix">
                <div class="chooseCity-province">
                    <span v-for="item in shopCategorys" :class="{active:item.mediaCategoryId==initId1}" @click="recruitCategorys(item.mediaCategoryId,1,item.name)">{{item.name}}</span>
                </div>
                <div class="chooseCity-city">
                    <span v-for="item in rCategorys" :class="{active:item.mediaCategoryId==initId2}" @click="recruitCategorys(item.mediaCategoryId,2,item.name)">{{item.name}}</span>
                </div>
                <div class="chooseCity-area">
                    <span v-for="item in rCategorys1" @click="getClass(item)">{{item.name}}</span>
                </div>
            </div>
        </template>
    </div>
    <div class="deliverGoods-btn" @click="deleteProduct()" v-if="type==1">删除商品</div>
    <div id="addGoodsInfo" :class="{'fixedShow':isGoodsInfo}">
        <div class="circleBar-top">
            <span class="goback" @click="getNext(1)"></span>
            商品图文描述
            <input type="submit" class="seeIndex-setUp" @click="createGroup()" value="保存">
        </div>
        <div class="addGoodsInfo">
            <div class="publish-article-content">
                <input type="hidden" id="target">
                <div class="article-content" id="content" v-html="list.content">
                </div>
                <div class="footer-btn g-image-upload-box">
                    <div class="upload-button">
                        <span class="upload">插入图片</span>
                        <input class="input-file" id="imageUpload" type="file" name="fileInput" accept="image/*">
                    </div>
                </div>
            </div>
        </div>
    </div>
    <prompt-view ref="prompt"></prompt-view>
</div>
<script src='/plugins/js/jquery-1.11.3.min.js'></script>
<script type="text/javascript" src="/plugins/js/vue.min.js"></script>
<!--<script type="text/javascript" src="/plugins/iosselect/iosSelect.js"></script>-->
<script type="text/javascript" src="/plugins/localResize/mobileFix.mini.js"></script>
<script type="text/javascript" src="/plugins/localResize/exif.js"></script>
<script type="text/javascript" src="/plugins/localResize/lrz.js"></script>
<script type="text/javascript" src="/plugins/artEditor/index.js"></script>
<script type="text/javascript" src="/js/see/addGoods.js?v=<%=$version%>"></script>
</body>
</html>